<div class="itemtitle s_clear">
	<h1>{lang task_detail}</h1>
	<button class="submit right" onclick="window.location.href='task.php?item={if $task[status] == '1'}done{elseif $task[status] == '0'}doing{elseif $task[status] == '-1'}failed{else}new{/if}'">{lang return}</button>
</div>
<!--{if $task['endtime']}--><p class="channelinfo">{lang task_endtime}</p><!--{/if}-->
<div class="datalist">
	<table cellpadding="0" cellspacing="0" class="datatable">
		<tr class="noborder">
			<td width="70"><img src="$task[icon]" alt="Icon" width="64" height="64" /></td>
			<td>
				<h5>$task[name]</h5>
				<!--{if $task[period]}--><p class="lighttxt">( {lang task_period} )</p><!--{/if}-->
				<p>$task[description]</p>
			</td>
		</tr>
		<tr class="noborder">
			<td></td>
			<td>
				<h5>{lang task_reward}</h5>
				<p class="emfont"><!--{if $task['reward'] == 'credit'}-->{lang credits} $extcredits[$task[prize]][title] $task[bonus] $extcredits[$task[prize]][unit]<!--{elseif $task['reward'] == 'magic'}-->{lang magics_title} $magicname $task[bonus]<!--{elseif $task['reward'] == 'medal'}-->{lang medals} $medalname {if $task['bonus']}{lang expire} $task[bonus] {lang days} {/if}<!--{elseif $task['reward'] == 'invite'}-->{lang invite_code} $task[prize] {lang expire} $task[bonus] {lang days}<!--{elseif $task['reward'] == 'group'}-->{lang usergroup} $grouptitle {if $task['bonus']} $task[bonus] {lang days} {/if}<!--{/if}--></p>
			</td>
		</tr>
		<tr class="noborder">
			<td></td>
			<td>
				<h5>{lang task_complete_condition}</h5>
				<!--{if $taskvars['complete']}-->
					<ul>
						<!--{if in_array($task['scriptname'], array('member', 'post', 'mod'))}-->
							<li>
								{lang task_complete_time_start}
								{if $taskvars[complete][time]}
									{lang task_complete_time_limit}
								{/if}
								{if $task[scriptname] == 'member'}
									{if $taskvars[complete][act][value] == 'buddy'}
										{lang task_complete_act_buddy}
									{elseif $taskvars[complete][act][value] == 'favorite'}
										{lang task_complete_act_favorite}
									{else}
										{lang task_complete_act_magic}
									{/if}
								{elseif $task[scriptname] == 'post'}
									{if $taskvars[complete][act][value] == 'newreply'}
										{if $taskvars[complete][threadid]}
											{lang task_complete_act_newreply_thread}
										{else}
											{lang task_complete_act_newreply_author}
										{/if}
									{else}
										{if $taskvars[complete][forumid]}
											{lang task_complete_forumid}
										{/if}
										{if $taskvars[complete][act][value] == 'newthread'}
											{lang task_complete_act_newthread}
										{else}
											{lang task_complete_act_newpost}
										{/if}
									{/if}
								{/if}
							</li>
						<!--{else}-->
							<!--{loop $taskvars['complete'] $taskvar}-->
								<li>$taskvar[name] :
									<!--{if $taskvar['variable'] == 'forumid'}-->
										<a href="forumdisplay.php?fid=$taskvar[value]">{$_DCACHE[forums][$taskvar[value]][name]}</a>
									<!--{elseif $taskvar['variable'] == 'threadid'}-->
										<a href="viewthread.php?tid=$taskvar[value]">$subject</a>
									<!--{elseif $taskvar['variable'] == 'authorid'}-->
										<a href="space.php?uid=$taskvar[value]">$author</a>
									<!--{else}-->
										$taskvar[value]
									<!--{/if}-->
								</li>
							<!--{/loop}-->
						<!--{/if}-->
					</ul>
				<!--{else}-->
					<p>{lang unlimited}</p>
				<!--{/if}-->
			</td>
		</tr>
		<tr class="noborder">
			<td></td>
			<td>
				<h5>{lang task_apply_condition}</h5>
				<!--{if $task[newbietask] == '1'}-->
					<p>{lang task_newbie_register_only}</p>
				<!--{elseif $task[newbietask] == '2'}-->
					<p>{lang task_newbie_all_members}</p>
				<!--{elseif $task[applyperm] || $task[relatedtaskid] || $task[tasklimits] || $taskvars['apply']}-->
					<ul>
						<li><!--{if $grouprequired}-->{lang usergroup}: $grouprequired <!--{elseif $task['applyperm'] == 'member'}-->{lang task_general_users}<!--{elseif $task['applyperm'] == 'admin'}-->{lang task_admins}<!--{/if}--></li>
						<!--{if $task[relatedtaskid]}--><li>{lang task_relatedtask}: <a href="task.php?action=view&id=$task[relatedtaskid]" class="lightlink">$taskrequired</a></li><!--{/if}-->
						<!--{if $task[tasklimits]}--><li>{lang task_numlimit}: $task[tasklimits]</li><!--{/if}-->
						<!--{if $taskvars['apply']}-->
							<!--{loop $taskvars['apply'] $taskvar}-->
								<li>$taskvar[name]: $taskvar[value]</li>
							<!--{/loop}-->
						<!--{/if}-->
					</ul>
				<!--{else}-->
					<p>{lang unlimited}</p>
				<!--{/if}-->
			</td>
		</tr>
		<tr class="noborder">
			<td></td>
			<td>
				<!--{if $task[newbietask] != '1'}-->
					<!--{if $allowapply == '-1'}-->
						<div class="taskbar">
							<div class="taskbar_text">{lang task_complete} <span id="csc_$task[taskid]">$task[csc]</span>%</div>
							<div class="optionbar" id="cscbar_$task[taskid]" style="width:$task[csc]%"></div>
						</div>
						<p id="reward_$task[taskid]"><a href="task.php?action=draw&id=$task[taskid]" onclick="tasknoticewin('$task[taskid]');return false;"><img src="images/tasks/{if $task[csc] >=100}reward.gif{else}rewardless.gif{/if}" /></a></p><br /><br />
					<!--{elseif $allowapply == '-2'}-->
						<p class="notice">{lang task_group_nopermission}</p>
						<a href="javascript:;" onclick="doane(event);showDialog('{lang task_group_nopermission}')"><img src="images/tasks/disallow.gif" title="{lang task_group_nopermission}" alt="{lang task_group_nopermission}" /></a><br /><br />
					<!--{elseif $allowapply == '-3'}-->
						<p class="notice">{lang task_applies_full}</p>
						<a href="javascript:;" onclick="doane(event);showDialog('{lang task_applies_full}')"><img src="images/tasks/disallow.gif" title="{lang task_applies_full}" alt="{lang task_applies_full}" /></a><br /><br />
					<!--{elseif $allowapply == '-4'}-->
						<p class="notice">{lang task_lose_on}$task[dateline]</p>
					<!--{elseif $allowapply == '-5'}-->
						<p class="notice">{lang task_complete_on}$task[dateline]</p>
					<!--{elseif $allowapply == '-6'}-->
						<p class="notice">{lang task_complete_on}$task[dateline] &nbsp; {$task[t]}{lang task_applyagain}</p>
						<a href="javascript:;" onclick="doane(event);showDialog('{$task[t]}{lang task_applyagain}')"><img src="images/tasks/disallow.gif" title="{$task[t]}{lang task_applyagain}" alt="{lang task_applies_full}" /></a><br /><br />
					<!--{elseif $allowapply == '-7'}-->
						<p class="notice">{lang task_lose_on}$task[dateline] &nbsp; {$task[t]}{lang task_reapply}</p>
						<a href="javascript:;" onclick="doane(event);showDialog('{$task[t]}{lang task_reapply}')"><img src="images/tasks/disallow.gif" title="{$task[t]}{lang task_reapply}" alt="{lang task_applies_full}" /></a><br /><br />
					<!--{elseif $allowapply == '2'}-->
						<p class="notice">{lang task_complete_on}$task[dateline] &nbsp; {lang task_applyagain_now}</p>
					<!--{elseif $allowapply == '3'}-->
						<p class="notice">{lang task_lose_on}$task[dateline] &nbsp; {lang task_reapply_now}</p>
					<!--{/if}-->
				<!--{elseif $allowapply == '-5'}-->
					<p class="notice">{lang task_complete_on}$task[dateline]</p>
				<!--{/if}-->

				<!--{if $allowapply > '0' && $task[newbietask] != '1'}-->
					<a href="task.php?action=apply&id=$task[taskid]"><img src="images/tasks/apply.gif" alt="{lang task_newbie_apply}" /></a><br /><br />
				<!--{elseif $allowapply == '-8'}-->
					<a href="$entrance"><img src="images/tasks/start.gif" alt="{lang task_newbie_start}" /></a><br /><br />
				<!--{/if}-->
			</td>
		</tr>
		<!--{if $task[applicants]}-->
		<tr>
			<td></td>
			<td>
				<a name="parter"></a>
				<div style="margin-top: 10px;">
					<div class="c_header">
						<h3 class="noarrow">{lang task_applicants}</h3>
					</div>
					<div id="ajaxparter"></div>
				</div>
				<script type="text/javascript">ajaxget('task.php?action=parter&id=$task[taskid]', 'ajaxparter');</script>
			</td>
		</tr>
		<!--{/if}-->
	</table>
</div>